<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Templates/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="PositionConfig.aspx.cs" Inherits="VIT.Web.Admin.PositionConfig" %>
<%@ Register Assembly="VIT.Web.Controls" Namespace="VIT.Web.Controls" TagPrefix="VIT" %>

<asp:Content ID="HeadContent" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="Includes/Validation/Validation.css" rel="stylesheet" type="text/css" />
    <script src="Includes/Validation/ValidationEngine.js" type="text/javascript"></script>
    <script src="Includes/Validation/Validation.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">    	       
   <form id="frmMain" runat="server"> 
       <!-- Content (Right Column) -->
        <div id="content" class="box">
            <div class="toolbar">
                <a href="<%=linkComponent("Home") %>"><img src="<%=URLRoot %>Admin/Includes/icons/icon-32-restore.png"/></a>
            </div> 
            <asp:Panel ID="pnAlert" runat="server">
                <p class="msg done" id="lblThanhCong" runat="server" visible="false">Data has been saved.</p>
                <p class="msg error" id="lblThatBai" runat="server" visible="false">Error, data can not saved.</p>
                <p class="msg info" id="lblDelete" runat="server" visible="false">Data has been deleted.</p>
	        </asp:Panel>
	        
            <fieldset style="clear:both">
			    <legend>Position Info</legend>     
                <table class="nostyle" style="float:left; width:90%">
                    <tr>
                        <td align="right" width="20%">Id : </td>
                        <td><asp:TextBox ID="txtId" runat="server" Width="250px" CssClass="validate[required]"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="right">Name : </td>
                        <td><asp:TextBox ID="txtName" runat="server" Width="250px" CssClass="validate[required]" MaxLength="100"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td align="right">Description : </td>
                        <td><asp:TextBox ID="txtDescription" runat="server" Width="400px" Height="100px" TextMode="MultiLine" MaxLength="1000"></asp:TextBox></td>
                    </tr>   
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="btnAdd" runat="server" Text=" Add New " onclick="btnAdd_Click" />&nbsp;
                            <asp:Button ID="btnSave" runat="server" Text=" Save " onclick="btnSave_Click" />
                        </td>
                    </tr>                
                </table>
            </fieldset>
            <fieldset style="clear:both">
			    <legend>Position List</legend>
			    <table>
                    <asp:ObjectDataSource ID="ODS" runat="server" SortParameterName="SortColumn" SelectMethod="GetData" TypeName="VIT.Web.Admin.PositionConfig">                  
                    </asp:ObjectDataSource>
                    <asp:ListView ID="ListView" runat="server" DataSourceID="ODS">
                        <LayoutTemplate>
                            <thead>
	                            <tr>
                                    <th width="2%">#</th>                                            
                                    <th width="20%">
                                        <asp:LinkButton ID="lnkName" runat="server" CommandName="Sort" CommandArgument="Name" Text="Name" />
                                    </th>
                                    <th>
                                        <asp:LinkButton ID="lnkDescription" runat="server" CommandName="Sort" CommandArgument="Description" Text="Description" />
                                    </th>
                                    <th width="7%">
                                        <asp:LinkButton ID="lnkId" runat="server" CommandName="Sort" CommandArgument="Id" Text="Id" />
                                    </th>
		                            <th width="5%">Edit</th>
		                            <th width="7%">Delete</th>
	                            </tr>			
                            </thead>
                            <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                        </LayoutTemplate>
                            
                        <ItemTemplate>
                            <tr class="row<%#Container.DataItemIndex%2 %>">
		                        <td align="center"><%#Container.DataItemIndex%></td>
	                            <td><%#Eval("Name")%></td>	                        
	                            <td><%#Eval("Description")%></td>
	                            <td align="center"><%#Eval("Id")%></td>	                            
                                <td align="center"><a href='PositionConfig.aspx?sId=<%#Eval("Id")%>'>Edit</a></td>
                                <td align="center"><a href='PositionConfig.aspx?act=Del&sId=<%#Eval("Id")%>' onclick="return confirm('Delete this position?');">Delete</a></td>
                            </tr>
                        </ItemTemplate> 
                    </asp:ListView>
                </table>
			</fieldset>    
            
            <script type="text/javascript">
                $("#aside ul li#config").addClass("submenu-active");
            </script>
        </div>
    </form>
</asp:Content>
